OAuth, OAuth server vs. OAuth client - #3115
Open
aishwaripahwa12 wants to merge 1 commit into
Open
Conversation
Appwrite WebsiteProject ID: Website (appwrite/website)Project ID: Tip Each function runs in its own isolated container with custom environment variables |
Contributor
Greptile SummaryThis PR adds two unlisted OAuth blog posts and their assets.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "latest seo blogs" | Re-trigger Greptile |
adityaoberai
requested changes
Jul 27, 2026
| - question: What does an OAuth server do? | ||
| answer: An OAuth server verifies the user’s identity, displays the consent screen, processes authorization requests, and issues access and refresh tokens. It may also validate, revoke, and rotate tokens. | ||
| --- | ||
| "OAuth server" and "OAuth client" get used interchangeably in a lot of tutorials, and that is where the confusion starts. They are not two names for the same thing. They are two different roles on opposite ends of the same authorization flow, and mixing them up leads to real bugs: tokens stored in the wrong place, secrets leaked to the browser, or a login flow that never completes. |
Contributor
There was a problem hiding this comment.
Not sure if this is a good fundamental reason for this blog to matter
|
|
||
| ## Public clients | ||
|
|
||
| A **public client** cannot keep a secret. Single-page apps, mobile apps, and desktop apps fall into this category, because any secret shipped in their code can be extracted. Public clients rely on the [PKCE extension](https://oauth.net/2/pkce/) (Proof Key for Code Exchange) instead of a client secret to protect the token exchange. |
Contributor
There was a problem hiding this comment.
PKCE is not mandatory unless OAuth 2.1 is followed
Comment on lines
+131
to
+146
| Here is what an OAuth2 login looks like with the Appwrite web SDK: | ||
|
|
||
| ```client-web | ||
| import { Client, Account, OAuthProvider } from "appwrite"; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') | ||
| .setProject('<PROJECT_ID>'); | ||
|
|
||
| const account = new Account(client); | ||
|
|
||
| account.createOAuth2Session({ | ||
| provider: OAuthProvider.Google, | ||
| success: 'https://example.com/success', | ||
| failure: 'https://example.com/failed' | ||
| }); |
Contributor
There was a problem hiding this comment.
We should link both the createOAuth2Session and createOAuth2Token flows
Contributor
There was a problem hiding this comment.
Is this intentionally off-centre?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


SEO blogs